<html>
<head>
    <css file="__PUBLIC__/css/body.css"/>
    <css file="__STATIC__/icon/icon.css"/>
</head>
<body>
    <div class="top">
        <div class="position"><span class="icon icon-31"></span>当前位置：用户列表</div>
        <div class="top-title">
            <span class="icon icon-32"></span>
            <div class="top-tool">
                <a href="{:U('Rbac/addUser')}" class="button-a">添加用户</a>
            </div>
        </div>
    </div>
    <div class="body">
        <table class="list-tb" border="0" cellpadding="0" cellspacing="4">
            <tr>
                <th width="5%">ID</th>
                <th width="25%">用户名</th>
                <th width="10%">上次登陆IP</th>
                <th width="10%">上次登陆时间</th>
                <th width="5%">状态</th>
                <th width="20%">所属角色</th>
                <th width="20%">操作</th>
            </tr>
           <foreach name='user' item='v'>
                    <tr>
                            <td >{$v.id}</td>
                            <td class="title"><a href="{:U('Rbac/modifyUser',array('uid'=>$v['id']))}">{$v.username}</a></td>
                            <td >{$v.loginip}</td>
                            <td >{$v.logintime|date='y-m-d H:i',###}</td>
                            <td >
                                <if condition='$v["lock"]'>锁定<else/>启用</if>
                            </td>
                            <td>
                                <if condition='$v["username"]==C("RBAC_SUPERADMIN")'>
                                    <span style="color:red;">超级管理员</span>
                                 <else/>
                                    <foreach name='v.role' item='mk'>
                                        {$mk.name}({$mk.remark})/
                                    </foreach>
                                </if>
                            </td>
                            <td class="operate">
                                <if condition='$v["username"]!=C("RBAC_SUPERADMIN")'>
                                        <if condition='$v["lock"]'>
                                            <a href="{:U('Rbac/lockUser',array('uid'=>$v['id'],'val'=>0))}"><span class="icon icon-41"></span>开启</a>
                                        <else/>
                                            <a href="{:U('Rbac/lockUser',array('uid'=>$v['id'],'val'=>1))}"><span class="icon icon-42"></span>锁定</a>
                                        </if>
                                    
                                        <a href="{:U('Rbac/modifyUser',array('uid'=>$v['id']))}"><span class="icon icon-43"></span>修改</a>
                                        <a href="{:U('Rbac/deleteUser',array('uid'=>$v['id']))}"><span class="icon icon-44"></span>删除</a>
                                <else/>
                                    &nbsp;
                                </if>
                                
                            </td>
                    </tr>
                </foreach>
        </table>
        <div class="page">{$page}</div>
    </div>
</body>
</html>